<template>
  <h4>组件 - setup属性</h4>
  <Child :name="name" @abc="fn2" />
</template>

<script setup>
// 有了setup属性以后，组件默认会注册
import Child from "./08-child.vue";
import { ref, onMounted } from "vue";

const name = ref("lisi");
onMounted(() => {
  setTimeout(() => {
    name.value = "wangwu";
  }, 2000);
});
const fn2 = () => {
  console.log("fn2");
};
</script>
